From 3dc6cedba55f3250175c56b913680d9bd7c9b1d4 Mon Sep 17 00:00:00 2001 From: Vivek Dasmohapatra Date: Thu, 22 Aug 2013 19:43:44 +0100 Subject: [PATCH] trivial-httpd: Close stdout & stdin so $() can capture output when daemonized Will be used by tests. --- src/ostree/ot-builtin-trivial-httpd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ostree/ot-builtin-trivial-httpd.c b/src/ostree/ot-builtin-trivial-httpd.c index 178f20c5..3c8fff9b 100644 --- a/src/ostree/ot-builtin-trivial-httpd.c +++ b/src/ostree/ot-builtin-trivial-httpd.c @@ -334,6 +334,9 @@ ostree_builtin_trivial_httpd (int argc, char **argv, GFile *repo_path, GCancella _exit (0); } /* Child, continue */ + /* Daemonising: close stdout/stderr so $() et al work on us */ + fclose (stdout); + fclose (stdin); } app->running = TRUE; -- 2.30.2